package com.example.demo.task;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.Date;

@Component
public class TestTask {
    @Scheduled(fixedRate = 1000)
    public void testFixRate() {
        System.out.println("每隔1秒执行一次：" + new Date());
    }
}
